<!DOCTYPE html>
<html>
<head>
    <script src="../../scripts/jquery.min.js"></script>
</head>
<body>
<style>
    div { margin:3px; width:40px; height:40px;
        position:absolute; left:0px; top:30px;
        background:green; display:none; }
    div.newcolor { background:blue; }
</style>
Click here...
<div></div>
<script>
    $(document.body).click(function () {
        $("div").show("slow");
        $("div").animate({left:'+=200'},2000);
        $("div").queue(function () {
            $(this).addClass("newcolor");
            $(this).dequeue();
        });
        $("div").animate({left:'-=200'},500);
        $("div").queue(function () {
            $(this).removeClass("newcolor");
            $(this).dequeue();
        });
        $("div").slideUp();
    });
</script>
</body>
</html>